//
//  SCCarMaintenTable.h
//  Shuaiche
//
//  Created by liyanan on 2019/8/6.
//  Copyright © 2019 zzs. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SCMaintenanceModel.h"

NS_ASSUME_NONNULL_BEGIN
@protocol SCCarMaintenTableDelegate <NSObject>

- (void)showMaintenanceDetailWithModel:(nullable SCMaintenanceModel *)model isShowMore:(BOOL)isShowMore;
@optional
- (void)footerViewBtnClick:(NSInteger)btnIndex;
@end


@interface SCCarMaintenTable : UITableView
@property (nonatomic, weak) id<SCCarMaintenTableDelegate> tableDelegate;

@property (nonatomic, assign) CGFloat sectionHeight; //默认为 53
@property (nonatomic, assign) NSInteger showCount;   //默认展示条数
@property (nonatomic, assign) NSInteger totalCount;  //默认展示条数
@property (nonatomic, assign) CGFloat moreHeight;    //更多按钮 默认高度 40；
@property (nonatomic, copy) NSString *moreTitle;     //更多按钮 title
@property (assign, nonatomic) CGFloat footerHeight;  //footerView height 有记录时，按钮距footerViwe顶部为30，无记录 按钮距提示文字30；
@property (assign, nonatomic) BOOL alwaysShowMore;  //更多按钮是否一直展示

@property (nonatomic, strong) UIColor *sectionBgColor; //sectionHeader 背景色 默认 SC_Color_Bg

/**设置tableFooterView
 * btnTitles footerView 按钮名
 * btnHeight 按钮高度
 * footerHeight footerView高度 默认为80
 */
- (void)showFooterViewWithBtnTitles:(NSArray *)btnTitles btnHeight:(CGFloat)btnHeight footerHeight:(CGFloat)footerHeigh configBtns:(nullable void(^)(NSArray *btns)) configBtnBlcok;

/**刷新tableView
 * totalCount 数据源总数
 * updateTableHeight table高度回调
 */
-(void)reloadTableView: (NSMutableArray *)dataArray totalCount:(NSInteger)totalCount updateConstraints: (nullable void(^)(CGFloat height)) updateTableHeight;

- (void)showFooterBtnAtIndex:(NSInteger)index isShow:(BOOL)isShow;

@end

NS_ASSUME_NONNULL_END
